<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>新客户登记 - 物流管理系统</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<style media="all" type="text/css">@import "../../style/all.css";</style>
	<script type="text/javascript" src="../../js/jquery-1.8.3.js"></script>
	<script type="text/javascript" language="javascript">
		$(function(){
			$("#btn2").click(function(){	
				  var customername = $("#customername").val();				
				  var idcard = $("#idcard").val();
				  var workplace = $("#workplace").val();
				  var phone = $("#phone").val();
				  var mobile = $("#mobile").val();
				  var address = $("#address").val();
				  var customerzipcode = $("#customerzipcode").val();
				  var email = $("#email").val();
				  var customerArea = $("#customerArea").val();
					$.ajax({
					   type:"post", //四种提交类型：get、post、put、delete
					   url:"../../customer/addCus",
					   contentType:"application/json",					
					   data:JSON.stringify({"customername": customername,"idcard": idcard,"workplace":workplace,"phone": phone,"mobile":mobile,"address":address,"customerzipcode":customerzipcode,"email":email,"customerArea":customerArea}),
					   success:function(result){
						   alert(result);
						   window.location.href='../../customer/getAllcustomer';
						   },
					 
				   });
			});
		})
	</script>
</head>
<body style="background: none">
	<div class="top-bar">
		<h1>新客户登记</h1>
		<div class="breadcrumbs">
			<div class="button-bar">
				<input type="button" name="Submit" value="帮助" class="button"/>
				<input type="button" class="button" id="btn2"  value="保存"/>
			</div>
			<a href="../../index.html" target="_top">首页</a> /
			<a href="../index.html" target="_top">客户服务中心</a>
		</div>
	</div>
<div class="select-bar">
<form name="frm1" method="post">
	<div class="table">
		<img src="../../style/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
		<img src="../../style/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
		<table class="listing form" cellpadding="0" cellspacing="0">
			<tr>
				<th class="full" colspan="4">添加新客户(*号为必填项)</th>
			</tr>
			<tr>
				<td class="first">客户姓名(*)</td>
				<td><input type="text" name="customername" id="customername" class="text" /></td>
				<td>身份证编号(*)</td>
				<td class="last"><input name="idcard" id="idcard" type="text" class="text" /></td>
			</tr>
			<tr>
				<td class="first">工作单位</td>
				<td><input type="text" class="text" name="workplace" id="workplace"/></td>
				<td>座机(*)</td>
				<td class="last"><input name="phone" id="phone" type="text" class="text" /></td>
			</tr>
			<tr class="bg">
				<td class="first">移动电话</td>
				<td><input type="text" name="mobile" id="mobile" class="text" /></td>
				<td>联系地址(*)</td>
				<td class="last"><input name="address" id="address" type="text" class="text" /></td>
			</tr>
			<tr>
				<td class="first">邮编</td>
				<td><input type="text" name="customerzipcode" id="customerzipcode" class="text" /></td>
				<td>E-mail</td>
				<td class="last"><input type="text" name=email id="email" class="text" /></td>
			</tr>
			<tr>
				<td class="first">区域(*)</td>
				<td><input name="customerArea" type="text" id="customerArea" class="text" /></td>
				<td></td>
				<td class="last"></td>
			</tr>
		</table>
		</div>
</form>
	</div>
</body>
</html>
